<?php
    if (!defined('EXPONENT')) exit('');
    if (exponent_users_isAdmin() ||  exponent_permissions_check(array("administrate"),$loc))
    {
        if($_REQUEST['clearall']==1)
        {
            $db->delete('mailsystem_log');
            mailsystemmodule::logMail('clearall',$user->email,$user->username." clear all log");
        }
        if (isset($_REQUEST['id']))
        {
            $id=intval($_REQUEST['id']);
            $db->delete('mailsystem_log', 'id = '.$id);
        }
        echo "OK";
    }
    else
        exponent_http_error(403);
?>
